﻿#region Creditos

/* Autor: Edilberto Sánchez Forero	*/
/* Email: esanchezfo@gmail.com		*/
/* Licencia: LGPL, Software Libre	*/
/* País: Colombia, Bogotá			*/

#endregion

#region Librerias

using ESF.SSO.Core.Entities.Exceptions;
using ESF.General;

#endregion


namespace ESF.SSO.ISO8583.RequestHandlers
{
	internal static class SSOISO8583ExceptionCodes
	{
		#region Constantes
		
		public const string USER_INVALIDCREDENTIALS = "13";
		public const string USER_DISABLED = "A4"; 
		public const string TERMINAL_INVALID = "A2";
		public const string TERMINAL_DISABLED = "58";
		
		#endregion
		
		#region Funciones
		
		public static string ToSSOExceptionCode (string pISO8583Code)
		{
			switch (pISO8583Code)
			{
				case SSOISO8583ExceptionCodes.USER_DISABLED:
					return SSOExceptionCodes.USER_DISABLED;
				
				case SSOISO8583ExceptionCodes.USER_INVALIDCREDENTIALS:
					return SSOExceptionCodes.USER_INVALIDCREDENTIALS;
				
				default: return GenericException.CRI_GENERAL;
			}
		}
		
		#endregion		
	}
}
